<?php 
$controller = Yii::app()->getController();
$isHome = $controller->getId() === 'site' && $controller->getAction()->getId() === 'index';
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
	<title><?php echo CHtml::encode($this->pageTitle); ?></title>
	<link href="<?php echo Yii::app()->request->baseUrl; ?>/css/fonts.css" rel="stylesheet" type="text/css" />
	<link href="<?php echo Yii::app()->request->baseUrl; ?>/css/style.css" rel="stylesheet" type="text/css" />
	<link href="<?php echo Yii::app()->request->baseUrl; ?>/css/style_new.css" rel="stylesheet" type="text/css" />
	<!--[if lt IE 9]> 
		<link href="<?php echo Yii::app()->request->baseUrl; ?>/skin/css/ie.css" rel="stylesheet" type="text/css"/>
		<script src="<?php echo Yii::app()->request->baseUrl; ?>/js/html5.js"></script> 
		<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/PIE.js"></script>
	<![endif]-->
	<?php
		Yii::app ()->clientScript->registerCoreScript ( 'jquery' );
		// Yii::app ()->clientScript->registerScriptFile ( '/js/jquery-1.8.3.min.js' );
		Yii::app ()->clientScript->registerScriptFile ( 'https://maps.googleapis.com/maps/api/js?key=AIzaSyAhu-npF1JRv634XqEUX8YIkDpk-zsThRM&sensor=false' );
		Yii::app ()->clientScript->registerScriptFile ( '/js/fieldstyle.js' );
		Yii::app ()->clientScript->registerScriptFile ( '/js/jquery-ui-1.9.2.custom.min.js' );
		Yii::app ()->clientScript->registerScriptFile ( '/js/main.js' );
		Yii::app ()->clientScript->registerScriptFile ( '/js/jquery.jscrollpane.js' );
		Yii::app ()->clientScript->registerScriptFile ( '/js/ajaxfileupload.js' );
	?>
</head>
<body>
	<?php if($isHome): ?>
	<section class="home_wrapper">
		<ul id="backslider">
			<li class="showed" style="background: url(/images/interior1.jpg)"></li>
			<li style="background: url(/images/interior2.jpg)"></li>
			<li style="background: url(/images/interior3.jpg)"></li>
			<li style="background: url(/images/interior4.jpg)"></li>
		</ul>
		<a id="hprev_lnk"><span></span></a>
		<a id="hnext_lnk"><span></span></a>
		<div class="wrapper cl">
			<div class="home_wrapper_holder">
				<section class="title_holder">
					<h1 class="home_title">
						WHOEVER WILL OPEN HIS HOUSE<br /> <span>TO BROTHERS IN CHRIST -</span><br />
						<strong>WILL BE BLESSED!</strong>
					</h1>
				</section>
				<article>
					Join our host &amp; guest community for free and gain 3 times: <br />
					make money &amp; fellowship &amp; blessing!
				</article>
				<a href="<?php echo Yii::app()->createUrl('site/page', array('alias'=>'make_money'));?>" class="make_money_lnk">
					<i>$</i>
					<span>MAKE MONEY WITH US —<br> <span>RENT YOUR SPACE!</span></span>
				</a>
				<a href="<?php echo Yii::app()->createUrl('site/page', array('alias'=>'how_work'));?>" class="how_it_works_lnk"><span>How it Works?</span><i></i></a>
				<div class="form_container">
					<h3>Find a place to stay.</h3>
					<form action="<?php echo Yii::app()->createUrl('cataloge/index');?>" method="get">
						<div class="destination_wrap br5">
							<input type="text" name="destination" value="Choose your destination..." class="destination br5" autocomplete="off" />
							<div class="destination_help">
								<ul class="variant"></ul>
							</div>
						</div>
						<div class="date_in br5" id="dateIn_home">
							<input type="text" name="check_in" value="" class="home_datePicker"><span></span><i><?php echo Yii::t('main', 'Check in') ?></i>
						</div>
						<div class="date_out br5" id="dateOut_home">
							<input type="text" name="check_out" value="" class="home_datePicker"> <span></span><i>Check out</i>
						</div>
						<div class="select br5 fl">
							<select name="guest" >
								<option>1 Guest</option>
								<option>2 Guests</option>
								<option>3 Guests</option>
								<option>4 Guests</option>
								<option>5 Guests</option>
								<option>6 Guests</option>
								<option>7 Guests</option>
								<option>8 Guests</option>
								<option>9 Guests</option>
								<option>10 Guests</option>
								<option>11 Guests</option>
								<option>12 Guests</option>
								<option>13 Guests</option>
								<option>14 Guests</option>
								<option>15 Guests</option>
								<option>16+ Guests</option>
							</select>
						</div>
						<span class="submit br5"><input type="submit" class="btn br5" value="" /></span>
						<a href="<?php echo Yii::app()->createUrl('cataloge/index');?>" class="adv_search fl"><?php echo Yii::t("main", "Advanced search");?></a>
					</form>
				</div>
			</div>
		</div>
	</section>
	<?php endif;?>
	<section class="container br5 <?php echo $isHome ? 'home_page' : '';?>">
		<header>
			<a href="/" id="logo"><img src="/images/logo.png" alt="logo" /></a>
			<nav class="fl">
				<ul id="nav">
					<li class="contact"><a href="<?php echo Yii::app()->createUrl('site/contact');?>"><?php echo Yii::t("main", "Contact us");?><span></span></a></li>
					<li class="bookmarks"><a href="<?php echo Yii::app()->createUrl('favorites/index');?>"><?php echo Yii::t("main", "Bookmarks");?><span></span></a></li>
					<?php if (Yii::app()->user->isGuest) : ?>
						<li class="log_in"><a href="<?php echo Yii::app()->createUrl('site/login');?>"><?php echo Yii::t("main", "Log in");?><span></span></a></li>
						<li class="sign_up"><a href="<?php echo Yii::app()->createUrl('site/registration');?>"><?php echo Yii::t("main", "Sign up");?><span></span></a></li>
					<?php else: ?>
						<li class="user_info">
							<span>
								<a href="<?php echo Yii::app()->createUrl('users/cabinet') ?>">
									Hello, <?php echo Yii::app()->user->name; ?>
								</a>
							</span>
							<a href="<?php echo Yii::app()->createUrl('site/logout');?>"><?php echo Yii::t("main", "Log out");?><span></span></a>
						</li>
					<?php endif; ?>
				</ul>
			</nav>
			<a href="<?php echo Yii::app()->createUrl('cataloge/create');?>" id="rent_btn" class="br5"><span class="br5"><?php echo Yii::t("main", "Rent your space");?></span></a>
			<div id="language-selector" >
			    <?php 
			        $this->widget('application.components.widgets.LanguageSelector');
			    ?>
			</div>
		</header>
		<div class="wrapper cl">
			<?php echo $content; ?>
			<div class="cl">
				<section class="b_btns_box">
					<h3><?php echo Yii::t("main", "Find us on");?>:</h3>
					<ul class="btns cl">
						<li class="facebook"><a href="#"></a></li>
						<li class="twitter"><a href="#"></a></li>
						<li class="google"><a href="#"></a></li>
						<li class="youtube"><a href="#"></a></li>
					</ul>
				</section>
				<div class="separator fl"> </div>
				<section class="b_btns_box">
					<h3><?php echo Yii::t("main", "We accept");?>:</h3>
					<ul class="btns cl">
						<li class="paypal"><a href="#"></a></li>
						<li class="mastercard"><a href="#"></a></li>
						<li class="visa"><a href="#"></a></li>
					</ul>
				</section>
			</div>
		</div>
	</section>
	<footer>
		<div class="br"></div>
	</footer>
<div class="overlay open" style="display:none">
	<div class="popup br15">
		<div class="close_btn"></div>
		<div id="show_popup">
			
		</div>
	</div>
</div>
</body>
</html>
